import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import {
	Button
} from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
import 'vant/lib/button/style'
import moment from 'moment'
Vue.filter('formatDate', (date, formatStr) => {
	moment.locale('zh-cn') //全局设置为中文显示 
	return moment(date).format(formatStr)
})

Vue.component(Button.name, Button)
Vue.config.productionTip = false
Vue.prototype.$axios=axios

new Vue({
	router,
	store,
	render: h => h(App),
	created() {
		this.$axios.get('http://116.63.80.218/products/list')
		.then(res=>{
			// console.log(res)
			this.$store.state.commodity=res.data
		})
		.catch(err=>{
			console.log(err)
		})
	},
}).$mount('#app')
